procedural logic of function calls in C